package cn.windy.samary.module.admin.service;

import cn.windy.samary.module.admin.common.Tree;
import cn.windy.samary.module.admin.common.UserVo;
import cn.windy.samary.module.admin.entity.Dept;
import cn.windy.samary.module.admin.entity.Permission;
import cn.windy.samary.module.admin.entity.Role;
import cn.windy.samary.module.admin.entity.User;
import cn.windy.samary.module.abstracts.service.IAbstractService;
import cn.windy.samary.utils.Res;

import java.util.List;

/**
 * @author zyl
 * @date 2018/5/21 14:37
 */
public interface IUserService extends IAbstractService<User> {

    List<Tree<Permission>> initMenu(String userId);

    @Override
    int insert(User user);

    int save(User user, String roles);

    int update(User user, String roles);

    int deleteByIds(List<String> ids);

    @Override
    int deleteByPrimaryKey(Object o);

    @Override
    int deleteByPrimaryKeys(List<String> primaryKeys);

    void setRole(String[] userIds, String[] roleIds);

    String getRoleShownameByUserId(String id);

    List<String> getRoleStringByUserId(String id);

    List<String> getPermissionStringByUserId(String userId);

    int adminResetPwd(User user);

    Res resetPwd(UserVo userVo);

    int updatePersonal(User user);

    Tree<Dept> getTree();

    List<Role> getRoleByUserId(String userId);

    /**
     * 根据角色值查询用户id
     *
     * @param realname 角色值
     * @return 用户id
     */
    List<String> findUserIdByRealname(String realname);
}
